package com.mspbots.core.report;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mspbots.core.AbstractBaseController;
import com.mspbots.core.report.model.HealthReportDTO;
import com.mspbots.core.report.model.TenantHealthReportDetail;
import com.mspbots.core.report.service.HealthReportService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@Log4j2
@RestController
@RequestMapping("health")
public class HealthReportController extends AbstractBaseController<TenantHealthReportDetail, HealthReportService> {


    @GetMapping(path = "/list-tenant")
    public Callable listTenant(Page<TenantHealthReportDetail> page, HealthReportDTO queryParams) {
        return () -> service.listTenant(page, queryParams);
    }


    @GetMapping(path = "/queryTenantHealth")
    public Callable queryTenantHealth(Long tenantId) {
        return () -> service.queryTenantHealth(tenantId);
    }


    @GetMapping(path = "/queryTenantKeySetting")
    public Callable queryTenantKeySetting(HealthReportDTO queryParams) {
        return () -> service.selectTenantKeySetting(queryParams);
    }

    @GetMapping(path = "/queryTenantAuthority")
    public Callable queryTenantAuthority(HealthReportDTO queryParams) {
        return () -> service.selectTenantAuthority(queryParams);
    }

    @GetMapping(path = "/queryLastSync")
    public Callable queryLastSync(HealthReportDTO queryParams) {
        return () -> service.selectLastSync(queryParams);
    }

    @GetMapping(path = "/queryTenantAdmin")
    public Callable queryTenantAdmin(HealthReportDTO queryParams) {
        return () -> service.selectTenantAdmin(queryParams);
    }


    @GetMapping(path = "/queryCountTenantUserMapping")
    public Callable queryCountTenantUserMapping(HealthReportDTO queryParams) {
        return () -> service.selectCountTenantUserMapping(queryParams);
    }

    @GetMapping(path = "/queryCountTenantUser")
    public Callable queryCountTenantUser(HealthReportDTO queryParams) {
        return () -> service.selectCountTenantUser(queryParams);
    }

    @GetMapping(path = "/queryTenantUserNotMapping")
    public Callable queryTenantUserNotMapping(HealthReportDTO queryParams) {
        return () -> service.selectTenantUserNotMapping(queryParams);
    }

    @GetMapping(path = "/queryTenantUserNoManager")
    public Callable queryTenantUserNoManager(HealthReportDTO queryParams) {
        return () -> service.selectTenantUserNoManager(queryParams);
    }

    @GetMapping(path = "/queryTenantUserNoWorkSchedule")
    public Callable queryTenantUserNoWorkSchedule(HealthReportDTO queryParams) {
        return () -> service.selectTenantUserNoWorkSchedule(queryParams);
    }


    @GetMapping(path = "/queryTenantBot")
    public Callable queryTenantBot(HealthReportDTO queryParams) {
        return () -> service.selectTenantBot(queryParams);
    }

    @GetMapping(path = "/queryCountMessages")
    public Callable queryCountMessages(HealthReportDTO queryParams) {
        return () -> service.selectCountMessages(queryParams);
    }

    @GetMapping(path = "/queryCountMessagesOnReceived")
    public Callable queryCountMessagesOnReceived(HealthReportDTO queryParams) {
        return () -> service.selectCountMessagesOnReceived(queryParams);
    }


    @GetMapping(path = "/queryTenantCount")
    public Callable queryTenantCount(HealthReportDTO queryParams) {
        return () -> service.listTenantCount(queryParams);
    }


    @GetMapping(path = "/queryCountUserNoReceived")
    public Callable queryCountUserNoReceived(HealthReportDTO queryParams) {
        return () -> service.selectCountUserNoReceived(queryParams);
    }

    @GetMapping(path = "/queryCountUserSendMessage")
    public Callable queryCountUserSendMessage(HealthReportDTO queryParams) {
        return () -> service.selectCountUserSendMessage(queryParams);
    }


    @GetMapping(path = "/queryCountUserHasReceived")
    public Callable queryCountUserHasReceived(HealthReportDTO queryParams) {
        return () -> service.selectCountUserHasReceived(queryParams);
    }

    @GetMapping(path = "/queryCountBotMessages")
    public Callable queryCountBotMessages(HealthReportDTO queryParams) {
        return () -> service.selectCountBotMessages(queryParams);
    }

    @GetMapping(path = "/queryLastTeamsLog")
    public Callable queryLastTeamsLog(HealthReportDTO queryParams) {
        return () -> service.selectLastTeamsLog(queryParams);
    }


}
